package com.ruicar.afs.cloud.product.enums;

/**
 * @author changyu.gui
 * @version 1.0
 * @date 2020/5/14 9:29
 */
public enum ATOM_CONTROL_TYPE {
    CHECK_BOX("复选", "00", "checkbox"),
    RADIO("单选", "01", "radio"),
    TEXT("文本", "02", "text"),
    DATE("日期", "03", "date"),
    DECIMAL("小数", "04", "decimal"),
    SCALE("比例", "05", "scale"),
    INTEGER("整数", "06", "number"),
    AMOUNT("金额", "07", "currency"),
    TIME("时间", "09", "time"),
    MULTIPLE_SELECT("下拉复选", "10", "multipleSelect"),
    SINGLE_SELECT("下拉单选", "11", "singleSelect");
    private String title;
    private String value;
    private String type;

    // 构造方法
    private ATOM_CONTROL_TYPE(String title, String value, String type) {
        this.title = title;
        this.value = value;
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public String getType() {
        return type;
    }

    // 获取产品类别
    public static String getType(String value) {
        for (ATOM_CONTROL_TYPE c : ATOM_CONTROL_TYPE.values()) {
            if (c.value.equals(value)) {
                return c.type;
            }
        }
        return null;
    }
}
